<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Consult extends Model
{
    protected $guarded = ['id'];

    public function replies()
    {
    	return $this->hasMany(ConsultReply::class);
    }

    

    public function getStatusStyleAttribute()
    {
    	return $this->status==1?'success':'danger';
    }

    public function getStatusTxtAttribute()
    {
    	return $this->status==1?'已回复':'待回复';
    }

    public function expert()
    {
        return $this->belongsTo(UserExpert::class);
    }

    public function wxuser()
    {
        return $this->belongsTo(WxuserInfo::class,'wxuser_openid','openid');
    }
}
